package top.mczhengyi.learn.hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import top.mczhengyi.learn.hello.bean.Pet;
import top.mczhengyi.learn.hello.bean.User;

@SpringBootApplication
public class MainApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);

        User user01 = run.getBean("user01", User.class);
        Pet pet01 = run.getBean("pet01", Pet.class);

        System.out.println("User是否和Pet为同一对象?" + (user01.getPet() == pet01));
    }
}
